This invention relates to pulse generation and/or sensing in microprocessor systems.
Pulse generation and/or sensing in microprocessor systems is conventionally accomplished by the use of a counter (timer) module associated with the microprocessor, typically integrated together as a microcontroller chip. Generating or sensing pulses typically takes a long time in relation to the processor execution time and typically suffers from some associated limitations.
In a typical application, the software running on the microprocessor has to be interrupted frequently to save intermediate captured timer values and to update output pulse timer values. In typical usage, the timing registers allow only single operations, after which the processor must save or update the current value. For example, to measure the width of a pulse using a timer with a single input capture register, the software must initially be informed that the pulse's first edge has occurred (e.g., via a flag bit and/or an interrupt), then it reads and saves a first value from the timer; then the software must await the pulse's second edge and read the associated timer value before it can calculate the pulse's width. Similarly, to create an output pulse, the software must provide the time of the pulse's first edge and then await the occurrence of that edge; after the pulse's first edge has occurred, the software can then provide the time of the pulse's second edge. In both such input measurement and such output pulse generation, the software response time limits the minimum pulse width that can be measured or generated.